package com.ruoyi.business.controller;

import com.ruoyi.business.service.ITRegisterPersonService;
import com.ruoyi.common.annotation.RateLimiter;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 学院端
 *
 * @author Tellsea
 * @date 2024/1/26
 */
@Api(tags = "我的Controller")
@RestController
@RequestMapping("/business/registerPerson")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class TRegisterPersonController {

    private final ITRegisterPersonService registerPersonService;

    @ApiOperation("全部设为已读")
    @PostMapping("/updateAllRead")
    @RateLimiter
    public AjaxResult updateAllRead() {
        return registerPersonService.updateAllRead();
    }

    @ApiOperation("下载申请表模板")
    @GetMapping("/downloadApplyTemplate")
    public void downloadApplyTemplate(@RequestParam("id") Long id) {
        registerPersonService.downloadApplyTemplate(id);
    }
}
